<?php
	//Busco las configuraciones de la web
	$configuracion = $this->m_configuracion->getConfiguracion();
?>

<!DOCTYPE html>
<html lang="es">
<head>
	<!-- start: Meta -->
	<meta charset="utf-8">
	<title><?php echo($configuracion->row()->titulo);?> - Login de Clientes</title>
	<meta name="description" content="<?php echo($configuracion->row()->descripcion);?> - Login de Clientes">
	<meta name="author" content="VeemeSoft">
	<!-- end: Meta -->
	
	<!-- start: Mobile Specific -->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- end: Mobile Specific -->
	
	<!-- start: CSS -->
	<link id="bootstrap-style" href="<?php echo(base_url()); ?>bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="<?php echo(base_url()); ?>bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
	<link id="base-style" href="<?php echo(base_url()); ?>bootstrap/css/style.css" rel="stylesheet">
	<link id="base-style-responsive" href="<?php echo(base_url()); ?>bootstrap/css/style-responsive.css" rel="stylesheet">
	
	<!--[if lt IE 7 ]>
	<link id="ie-style" href="<?php echo(base_url()); ?>bootstrap/css/style-ie.css" rel="stylesheet">
	<![endif]-->
	<!--[if IE 8 ]>
	<link id="ie-style" href="<?php echo(base_url()); ?>bootstrap/css/style-ie.css" rel="stylesheet">
	<![endif]-->
	<!--[if IE 9 ]>
	<![endif]-->	
	<!-- end: CSS -->
	
	<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

	<!-- start: Favicon -->
	<link rel="shortcut icon" href="<?php echo(base_url()); ?>bootstrap/img/favicon.ico">
	<!-- end: Favicon -->
	
	<style type="text/css">
		body { background: url('<?php echo(base_url()); ?>bootstrap/img/bg-login.jpg') !important; }
	</style>
	
	<!-- start: JavaScript-->
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery-1.9.1.min.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery-migrate-1.0.0.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery-ui-1.10.0.custom.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.ui.touch-punch.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/bootstrap.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.cookie.js"></script>	
	<script src='<?php echo(base_url()); ?>bootstrap/js/fullcalendar.min.js'></script>	
	<script src='<?php echo(base_url()); ?>bootstrap/js/jquery.dataTables.min.js'></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/excanvas.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.flot.min.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.flot.pie.min.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.flot.stack.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.flot.resize.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.chosen.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.uniform.min.js"></script>		
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.cleditor.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.noty.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.elfinder.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.raty.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.iphone.toggle.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.uploadify-3.1.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.gritter.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.imagesloaded.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.masonry.min.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.knob.js"></script>	
	<script src="<?php echo(base_url()); ?>bootstrap/js/jquery.sparkline.min.js"></script>
	<script src="<?php echo(base_url()); ?>bootstrap/js/custom.js"></script>
	
	<script type="text/javascript">
		//Esto se ejecuta cuando se termina de cargar la web
		$(document).ready(function(){
			//Le damos el foco al primer campo del formulario
			$("#username").focus();
		});
	</script>
	
	<script type="text/javascript">
		//Esto se ejecuta al apretar el boton: Login
		function iniciarSesion(){
			usuario = document.getElementById("username");
			password = document.getElementById("password");
			
			if(usuario.value != ""){
				if(password.value != ""){
					if(password.value.length >= 6){
						document.formIngreso.submit();
					}else{
						alert("Disculpe, la longitud del password debe ser de al menos 6 caracteres.");
					}		
				}else{
					alert("Disculpe, debe ingresar un password para iniciar sesi\u00f3n.");
				}
			}else{
				alert("Disculpe, debe ingresar un usuario para iniciar sesi\u00f3n.");
			}
		}
		
		//Esto se ejecuta al apretar en el campo password, la tecla enter
		function enterIniciarSesion(){
			//Si apreto la tecla enter
			if (window.event.keyCode == 13){
				//window.event.keyCode =9;					
				iniciarSesion();
			}
		}
	</script>	
	<!-- end: JavaScript-->
</head>

<body>
	<div class="container-fluid">
		<div class="row-fluid">					
			<div class="row-fluid">
				<div class="login-box">
					<div class="icons">
						<a href="<?php echo(site_url("inicio")); ?>"><i class="icon-home"></i></a>
						<!--<a href="#"><i class="icon-cog"></i></a>-->
					</div>
					
					<h2>Ingrese a su cuenta:</h2>
					<form name="formIngreso" class="form-horizontal" action="<?php echo(site_url("usuario/iniciarSesion")); ?>" method="post">
						<fieldset>					
							<div class="input-prepend" title="Usuario">
								<span class="add-on"><i class="icon-user"></i></span>
								<input class="input-large span10" name="username" id="username" type="text" value="<?php echo(get_cookie('usuario')); ?>" placeholder="Su usuario:"/>
							</div>
							<div class="clearfix"></div>

							<div class="input-prepend" title="Password">
								<span class="add-on"><i class="icon-lock"></i></span>
								<input class="input-large span10" name="password" id="password" type="password" value="<?php echo(get_cookie('password')); ?>" placeholder="Su password:" onkeypress="enterIniciarSesion()"/>
							</div>
							<div class="clearfix"></div>
							
							<?php if($error == true ){ ?>
								<p style="color:red"> <?php echo($mensajeError); ?> </p>
							<?php } ?>
							
							<label class="remember" for="remember"><input type="checkbox" name="remember" id="remember" />Recordarme</label>

							<div class="button-login">	
								<button type="button" class="btn btn-primary" onclick="iniciarSesion()"><i class="icon-off icon-white"></i> Login</button>
							</div>
							<div class="clearfix"></div>
					</form>
					<hr>
					<h3>Se olvido su usuario y/o password?</h3>
					<p>
						No se preocupe, haga <a href="<?php echo(site_url("usuario/recordarDatos")); ?>">click aqu&iacute;</a> para obtener un nuevo password o recordar su usuario.
					</p>
				</div><!--/span-->
			</div><!--/row-->
		</div><!--/fluid-row-->
	</div><!--/.fluid-container-->
</body>
</html>
